return "Drag to slider 'handle' to enable control of video play time. Requires additional 'extent' member which limits the handle travel range." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Video Sprite - Enter the number of sprite channel in which video is displayed." & RETURN & "ΓÇó Extent Sprite - Enter the number of sprite channel that contains the 'extent' sprite." & RETURN & "ΓÇó Hilite Member - Member to display while handle is being dragged." & RETURN & "ΓÇó Horizontal - If set, orient extent sprite horizontally, if not set orient vertically." & RETURN & "ΓÇó Dynamic - If set, video time will be updated while handle is dragged, else when handle is released."
end
on compute_val me
val = 0.0
val = float(me.currentScreenVal) / float(me.extentlength)
val = val * me.valrange
val = val + me.min
return val
end
on send_the_val me, val
pMovieTime = val * pDuration
videoseek(sprite(videoSprite), pMovieTime)
end
on beginSprite me
pDuration = sprite(videoSprite).duration
me.min = 0.0
me.max = 1.0
me.sending = 1
handle = me.spriteNum
me.tracking = 0
me.newLocH = the locH of sprite handle
me.newLocV = the locV of sprite handle
if me.horizontal then
me.newLocV = the locV of sprite me.extentSprite
me.minScreen = the left of sprite me.extentSprite
me.maxScreen = the right of sprite me.extentSprite
else
me.newLocH = the locH of sprite me.extentSprite
me.minScreen = the left of sprite me.extentSprite
me.maxScreen = the right of sprite me.extentSprite
end if
set the locH of sprite handle to me.newLocH
set the locV of sprite handle to me.newLocV
me.valrange = me.max - me.min
me.extentlength = me.maxScreen - me.minScreen
if me.sending = 0 then
me.dynamic = 0
end if
end
on prepareFrame me
if tracking then
handle = me.spriteNum
extent = me.extentSprite
if me.horizontal then
me.newLocH = the mouseH
me.newLocV = the locV of sprite extent
if me.newLocH < the left of sprite extent then
me.newLocH = the left of sprite extent
end if
if me.newLocH > the right of sprite extent then
me.newLocH = the right of sprite extent
end if
me.currentScreenVal = me.newLocH - me.minScreen
else
me.newLocH = the locH of sprite extent
me.newLocV = the mouseV
if me.newLocV < the top of sprite extent then
me.newLocV = the top of sprite extent
end if
if me.newLocV > the bottom of sprite extent then
me.newLocV = the bottom of sprite extent
end if
me.currentScreenVal = me.newLocV - me.minScreen
end if
set the locH of sprite handle to me.newLocH
set the locV of sprite handle to me.newLocV
if me.dynamic then
send_the_val(me, compute_val(me))
end if
else
x = float(sprite(videoSprite).currentTime) / float(pDuration)
handle = me.spriteNum
extent = me.extentSprite
if me.horizontal then
ScreenX = the left of sprite extent + (x * (the right of sprite extent - the left of sprite extent))
me.newLocH = ScreenX
me.newLocV = the locV of sprite extent
if me.newLocH < the left of sprite extent then
me.newLocH = the left of sprite extent
end if
if me.newLocH > the right of sprite extent then
me.newLocH = the right of sprite extent
end if
me.currentScreenVal = me.newLocH - me.minScreen
else
ScreenY = the top of sprite extent + (x * (the bottom of sprite extent - the top of sprite extent))
me.newLocH = the locH of sprite extent
me.newLocV = ScreenY
if me.newLocV < the top of sprite extent then
me.newLocV = the top of sprite extent
end if
if me.newLocV > the bottom of sprite extent then
me.newLocV = the bottom of sprite extent
end if
me.currentScreenVal = me.newLocV - me.minScreen
end if
set the locH of sprite handle to me.newLocH
set the locV of sprite handle to me.newLocV
end if
end
on mouseDown me
tracking = 1
temp = the member of sprite me.spriteNum
set the member of sprite the spriteNum of me to member(me.hiliteMember)
me.hiliteMember = temp
end
on mouseUp me
tracking = 0
temp = the member of sprite me.spriteNum
set the member of sprite the spriteNum of me to member(me.hiliteMember)
me.hiliteMember = temp
if me.sending then
x = compute_val(me)
send_the_val(me, x)
end if
end
on mouseUpOutSide me
tracking = 0
temp = the member of sprite me.spriteNum
set the member of sprite the spriteNum of me to member(me.hiliteMember)